using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter22
{
	/// <summary>
	/// Example01: The Efficient of an Engine
	/// An engine transfers 2.0 \times 10^3 J of energy from
	/// a hot reservoir during a cycle and transfers 
	/// 1.5 \times 10^3 J as exhaust to a cold reservoir.
	/// (A) Find the efficiency of the engine.
	/// e = 0.25 or 25%
	/// (B) How much work does this engine do in one cycle?
	/// W_{eng} = 5.0 \times 10^2 J
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Heat hot = new L.Heat();
			hot.J = 2.0E3;
			L.Heat cold = new L.Heat();
			cold.J = 1.5E3;
			double efficient = (hot.J - cold.J)/hot.J;
			result+=Convert.ToString(efficient)+"\r\n";
			result+=Convert.ToString(hot.J - cold.J)+"\r\n";
		}
		
	}
}
